/* share 组件 */
@import "../../styles/lib/animation";

/* share按钮 */
.share-button {
  position: fixed;
  right: 20px;
  bottom: 80px;
  z-index: 200;

  width: 36px;
  height: 36px;
  border-radius: 50%;

  box-shadow: 1px 1px 3px rgb(127 127 127 / 15%);

  &.hover {
    background-color: rgb(127 127 127 / 15%);
  }

  .icon {
    width: 100%;
    height: 100%;
  }
}

.share-wrapper {
  opacity: 0;
  visibility: hidden;
  transition: all 0.3s;

  &.show {
    opacity: 1;
    visibility: visible;
  }

  .share-menu {
    position: fixed;
    right: 0;
    bottom: 0;
    left: 0;
    z-index: 5000;

    overflow: hidden;

    max-height: 75%;
    border-top-left-radius: 12px;
    border-top-right-radius: 12px;

    background-color: #f4f4f4;

    line-height: 1.4;

    transition: all 0.3s;

    transform: translateY(100%);

    @media (prefers-color-scheme: dark) {
      background-color: #0d0d0d;
    }
  }

  &.show .share-menu {
    transform: translateY(0);
  }

  .action-list {
    display: flex;
    align-items: center;
    justify-content: flex-start;

    width: calc(100% - 20px);
    height: 104px;
    margin-top: 16px;
    padding: 0 10px;
  }

  .action {
    flex-shrink: 0;
    padding: 0 10px;
    text-align: center;

    .icon-wrapper {
      width: 52px;
      height: 52px;
      margin-bottom: 8px;
      padding: 10px;
      border: none;
      border-radius: 12px;

      background-color: #fff;

      @media (prefers-color-scheme: dark) {
        background-color: #1c1c1e;
      }
    }

    .icon {
      width: 32px;
      height: 32px;
    }

    .text {
      color: var(--dark-grey);
      font-weight: 400;
      font-size: 10px;
    }
  }

  .cancel-button {
    width: 100%;
    min-height: 48px;
    padding: 12px 24px;
    border: none;
    border-radius: 0;

    background-color: #fff;
    color: var(--text-color);

    font-weight: 400;

    @supports (padding-bottom: env(safe-area-inset-bottom)) {
      padding-bottom: calc(12px + env(safe-area-inset-bottom));
    }

    @media (prefers-color-scheme: dark) {
      background-color: #1c1c1e;
    }
  }
}
